﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace LucyGrid
{
	class GridTask
	{
		public static Thread Run(Action func)
		{
			var t = new Thread(() => func());
			t.Start();
			return t;
		}

		public static bool WaitAll(IEnumerable<Thread> threads, int timeout)
		{
			return threads.All(t => t.Join(timeout));
		}
	}
}
